package com.hs.sfzy.service.impl;

import com.hs.sfzy.entity.UserSearchRecord;
import com.hs.sfzy.mapper.UserSearchRecordMapper;
import com.hs.sfzy.service.UserSearchRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName UserSearchRecordServiceImpl
 * @Description TODO
 * @Author cuipengwei
 * @Date 2025年08月14日 16:15
 * @Version 1.0
 */
@Service
public class UserSearchRecordServiceImpl implements UserSearchRecordService {
    @Autowired
    private UserSearchRecordMapper userSearchRecordMapper;
    //增加
    @Override
    public Integer addUserSearchRecord(UserSearchRecord userSearchRecord) {
        Integer i = userSearchRecordMapper.addUserSearchRecord(userSearchRecord);
        return i;
    }
    //删除
    @Override
    public Integer deleteUserSearchRecord(Integer id) {
        Integer i = userSearchRecordMapper.deleteUserSearchRecord(id);
        return i;
    }
    //获取全部
    @Override
    public List<UserSearchRecord> getAllUserSearchRecord() {
        List<UserSearchRecord> allUserSearchRecord = userSearchRecordMapper.getAllUserSearchRecord();
        return allUserSearchRecord;
    }

    //根据id查询
    @Override
    public UserSearchRecord getUserSearchRecordById(Integer id) {
        UserSearchRecord userSearchRecordById = userSearchRecordMapper.getUserSearchRecordById(id);
        return userSearchRecordById;
    }
    //清除
    @Override
    public Integer deleteByUserId(Integer userId) {
        Integer i = userSearchRecordMapper.deleteByUserId(userId);
        return i;
    }
    //根据用户id查询
    @Override
    public List<UserSearchRecord> getAllUserSearchRecordByUserId(Integer userId) {
        List<UserSearchRecord> allUserSearchRecordByUserId = userSearchRecordMapper.getAllUserSearchRecordByUserId(userId);
        return allUserSearchRecordByUserId;
    }
}